package com.example.mid;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class DisplayActivity extends AppCompatActivity {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_display);
        //获取意图
        Intent intent = getIntent();
        //获取意图中的附加数据
        String msg_id=intent.getStringExtra(MainActivity.EXTRA_MESSAGE_ID);
        String msg_name = intent.getStringExtra(MainActivity.EXTRA_MESSAGE_NAME);
        System.out.println(msg_id+","+msg_name);
        //TextView中显示消息
        TextView tv_show_id = findViewById(R.id.tv_show_id);
        TextView tv_show_name = findViewById(R.id.tv_show_name);
        tv_show_id.setText(msg_id);
        tv_show_name.setText(msg_name);
    }
}
